package com.pan.entity;

import com.pan.enume.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
    Integer code;
    String message;
    T data;

    public Result(ResultEnum result){
        code = result.getCode();
        message = result.getMessage();
    }
    public Result(ResultEnum result,T data){
        code = result.getCode();
        message = result.getMessage();
        this.data = data;
    }
}
